/* 
 * 协议脚本
 */
//const SonAgreement = require('@/static/js/Agreement/5101_Sanhe_YBKC.js')
import YBKC_Sanhe_5101 from '@/static/js/Agreement/YBKC_Sanhe_5101.js'
import QFC_GUANGLU_IP65 from '@/static/js/Agreement/QFC_GUANGLU_IP65.js'
import CK_001 from '@/static/js/Agreement/CK_001.js'
class Agreement {
	//初始化协议构造函数
	constructor() {}
	//连接方法，用户设备连接的初始化方法
	//1、需连接的设备Id
	//2、回调参数为连接时返回的设备列表
	//3、连接成功后的回调函数
	Link(connectId, callBackDeviceList, callBackLinkSuccess) { // 连接
	}
	StopFind() { // 停止扫描
	}
	//获取状态，通过监听实时返回设备当前的状态
	//1、回调参数当前设备的状态
	GetStatus() {}
	//停止设备连接，中断设备连接
	Disconnect(deviceId,callBackLinkDisConnect) { // 断开
	}
	//获取数据的回调函数
	//回调实际返回的真实值
	CallBackGetData(callBackData) { // 返回获取的数据
	}
	//写入函数，暂时保留
	WriteData() { // 写入数据
	}
	//获取串口PortName
	getPortName(deviceId, callBackPortNameList) {
	
	}
	//工厂方法，构建具体子类调用的协议类
	static createDeviceAgreement(agreementName) {
		var agreementObj = {};

		switch (agreementName) {
			case 'YBKC_Sanhe_5101': {
				agreementObj = new YBKC_Sanhe_5101();
				break;
			}
			case 'QFC_GUANGLU_IP65': {
				agreementObj = new QFC_GUANGLU_IP65();
				break;
			}
			case 'CK_001': {
				agreementObj = new CK_001();
				break;
			}
		}
		return agreementObj;
	}
}

export default Agreement